package pl.poznan.put.cs.idss.students.coolring.properties;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Properties {
	private static final String BUNDLE_NAME = "locales.definitions"; //$NON-NLS-1$

	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
			.getBundle(BUNDLE_NAME);

	private Properties() {
	}

	public static String get(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return ("! KEY: " + key + " is not defined. Add key-value pair to properties.properties file.");
		}
	}
	
	public static int number(String key) {
		try {
			return Integer.parseInt(get(key));
		} catch(Exception e) {
			return -1;
		}
	}
}
